/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package de.swa.testvalid.boundary;

import de.swa.testvalid.control.UserRepository;
import de.swa.testvalid.entity.MyUser;
import java.util.ArrayList;
import java.util.List;
import javax.enterprise.inject.Model;
import javax.inject.Inject;

/**
 *
 * @author felix
 */
@Model
public class UserUIModel {
    @Inject
    UserRepository userRepos;
    @Inject
    MyUser user;
    List<MyUser> userList = new ArrayList<MyUser>();

    public UserUIModel() {
    }

    public MyUser getUser() {
        return user;
    }

    public void setUser(MyUser user) {
        this.user = user;
    }

    public void addUser() {
        this.userRepos.addUser(this.user);
    }

    public List<MyUser> getUserList() {
        userList = userRepos.getMember();
        return userList;
    }

    public void setUserList(List<MyUser> userList) {
        this.userList = userList;
    }
}
